#ifndef _DATA_MANAGE_H_
#define _DATA_MANAGE_H_

#include <stdint.h>

#define PAGE_SIZE                       1024    // Bytes per page

#define CONFIG_FILE_FAGE                255     // Page of offset data
#define CONFIG_DATA_OUT_MODE_PAGE       254     // Page of data out mode 
#define CONFIG_GAME_INDEX				253		// Page of game index

typedef struct
{
    uint32_t acc_bias[3];
    uint32_t gyro_bias[3];
    uint32_t frequence;
}data_manage_t;

void load_data(void);
void save_data(void);

typedef enum
{
    DATA_FOR_ANO,
    DATA_FOR_CAPTURE,
}Date_out_mode;     // enum container owns 1 byte


inline void set_data_out_mode(Date_out_mode mode);
inline Date_out_mode get_data_out_mode(void);
void save_data_out_mode(void);
void load_data_out_mode(void);
void set_acc_gyro_to_conf_data(long *acc, long *gyro);

void save_app_type(uint32_t index);
void load_app_type(void);

#endif

